//
//  PersonInfoTableViewCell.m
//  lsOA
//
//  Created by 蓝水软件 on 2016/11/23.
//  Copyright © 2016年 苏州蓝水有限公司. All rights reserved.
//

#import "PersonInfoTableViewCell.h"

@implementation PersonInfoTableViewCell{
    UILabel *label;
    UILabel *Infor;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        label = [[UILabel alloc]init];
        [self.contentView addSubview:label];
        [label mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(50);
            make.centerY.equalTo(self.contentView);
            make.width.mas_equalTo(80);
        }];
        Infor = [[UILabel alloc]init];
        [self.contentView addSubview:Infor];
        [Infor mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(label.mas_right).offset(15);
            make.centerY.equalTo(self.contentView);
        }];

    }
    return self;
}

- (void)setvalueWithleftString:(NSString *)leftString rightString:(NSString *)rightString{
  
    
    
    label.text = [leftString stringByAppendingString:@":"];
    Infor.text = @"❌";
    if (rightString.length > 0) {
        Infor.text = rightString;
    }
    NSArray *phoneArray = @[@"Phone",@"Tel"];
    if ([phoneArray containsObject:leftString]) {
        UIImageView *phone = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"手机"]];
        [self.contentView addSubview:phone];
        [phone mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(label.mas_left).offset(-10);
            make.centerY.equalTo(self.contentView);
            make.size.mas_equalTo(LRLCGSizeMake(25,25));
        }];
    }


}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
